<?php
namespace app\api\controller;
use think\Request;

class Controller{
    protected $params;

    public function __construct(Request $request)
    {
        $method = $request->method(); // 请求方法
        $this->params = $request->param(); // 请求数据
        if($method != 'POST') Exception("请求方式不对");
        if(!isset($this->params['supplierCode'])) Exception("缺少supplierCode参数");
        if(!isset($this->params['token'])) Exception("缺少token参数");
        if(!verify_token($this->params['supplierCode'],$this->params['token'])) Exception('token有误，或者已过期');
    }
}